# Makefile
# James S. Plank
# 
# JERASURE - Library for Erasure Coding
# Copright (C) 2007 James S. Plank
# 
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
# 
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
# 
# James S. Plank
# Department of Electrical Engineering and Computer Science
# University of Tennessee
# Knoxville, TN 37996
# plank@cs.utk.edu

# $Revision: 1.0 $
# $Date: 2007/09/25 15:12:20 $

CC = g++
CFLAGS = -g -I$(HOME)/include

ALL =     liberation-2.h   \
          liberation-2.cpp \
					cauchy-2.h       \
					cauchy-2.cpp     \
					reed_sol-2.h     \
					reed_sol-2.cpp   \
					jerasure-2.h     \
					jerasure-2.cpp   \
					galois-2.h       \
					galois-2.cpp     \
					jerasure_01      \
					jerasure_02      \
					jerasure_03      \
					jerasure_04      \
					jerasure_05      \
					jerasure_06      \
					jerasure_07      \
					jerasure_08      \
					reed_sol_01      \
					reed_sol_02      \
					reed_sol_03      \
					reed_sol_04      \
					cauchy_01        \
					cauchy_02        \
					cauchy_03        \
					cauchy_04        \
					encoder		     \
					decoder			 \
					liberation_01    

all: $(ALL)

clean:
	rm -f core *.o $(ALL) a.out

.SUFFIXES: .cpp .o
.cpp.o:
	$(CC) $(CFLAGS) -c $*.cpp

liberation-2.h: ../liberation-2.h
	rm -f liberation-2.h ; cp ../liberation-2.h . ; chmod 0444 liberation-2.h

liberation-2.cpp: ../liberation-2.cpp
	rm -f liberation-2.cpp ; cp ../liberation-2.cpp . ; chmod 0444 liberation-2.cpp

cauchy-2.h: ../cauchy-2.h
	rm -f cauchy-2.h ; cp ../cauchy-2.h . ; chmod 0444 cauchy-2.h

cauchy-2.cpp: ../cauchy-2.cpp
	rm -f cauchy-2.cpp ; cp ../cauchy-2.cpp . ; chmod 0444 cauchy-2.cpp

reed_sol-2.h: ../reed_sol-2.h
	rm -f reed_sol-2.h ; cp ../reed_sol-2.h . ; chmod 0444 reed_sol-2.h

reed_sol-2.cpp: ../reed_sol-2.cpp
	rm -f reed_sol-2.cpp ; cp ../reed_sol-2.cpp . ; chmod 0444 reed_sol-2.cpp

jerasure-2.h: ../jerasure-2.h
	rm -f jerasure-2.h ; cp ../jerasure-2.h . ; chmod 0444 jerasure-2.h

jerasure-2.cpp: ../jerasure-2.cpp
	rm -f jerasure-2.cpp ; cp ../jerasure-2.cpp . ; chmod 0444 jerasure-2.cpp

galois-2.h: ../galois-2.h
	rm -f galois-2.h ; cp ../galois-2.h . ; chmod 0444 galois-2.h

galois-2.cpp: ../galois-2.cpp
	rm -f galois-2.cpp ; cp ../galois-2.cpp . ; chmod 0444 galois-2.cpp

galois-2.o: galois-2.h
jerasure-2.o: jerasure-2.h galois-2.h
cauchy-2.o: cauchy-2.h
reed_sol-2.o: reed_sol-2.h

reed_sol_01: galois-2.o jerasure-2.o reed_sol-2.o reed_sol_01.o
	$(CC) $(CFLAGS) -o reed_sol_01 galois-2.o jerasure-2.o reed_sol-2.o reed_sol_01.o

reed_sol_02: galois-2.o jerasure-2.o reed_sol-2.o reed_sol_02.o
	$(CC) $(CFLAGS) -o reed_sol_02 galois-2.o jerasure-2.o reed_sol-2.o reed_sol_02.o

reed_sol_03: galois-2.o jerasure-2.o reed_sol-2.o reed_sol_03.o
	$(CC) $(CFLAGS) -o reed_sol_03 galois-2.o jerasure-2.o reed_sol-2.o reed_sol_03.o

reed_sol_04: galois-2.o jerasure-2.o reed_sol-2.o reed_sol_04.o
	$(CC) $(CFLAGS) -o reed_sol_04 galois-2.o jerasure-2.o reed_sol-2.o reed_sol_04.o

jerasure_01: galois-2.o jerasure-2.o jerasure_01.o
	$(CC) $(CFLAGS) -o jerasure_01 galois-2.o jerasure-2.o jerasure_01.o

jerasure_02: galois-2.o jerasure-2.o jerasure_02.o
	$(CC) $(CFLAGS) -o jerasure_02 galois-2.o jerasure-2.o jerasure_02.o

jerasure_03: galois-2.o jerasure-2.o jerasure_03.o
	$(CC) $(CFLAGS) -o jerasure_03 galois-2.o jerasure-2.o jerasure_03.o

jerasure_04: galois-2.o jerasure-2.o jerasure_04.o
	$(CC) $(CFLAGS) -o jerasure_04 galois-2.o jerasure-2.o jerasure_04.o

jerasure_05: galois-2.o jerasure-2.o jerasure_05.o
	$(CC) $(CFLAGS) -o jerasure_05 galois-2.o jerasure-2.o jerasure_05.o

jerasure_06: galois-2.o jerasure-2.o jerasure_06.o
	$(CC) $(CFLAGS) -o jerasure_06 galois-2.o jerasure-2.o jerasure_06.o

jerasure_07: galois-2.o jerasure-2.o jerasure_07.o
	$(CC) $(CFLAGS) -o jerasure_07 galois-2.o jerasure-2.o jerasure_07.o

jerasure_08: galois-2.o jerasure-2.o jerasure_08.o
	$(CC) $(CFLAGS) -o jerasure_08 galois-2.o jerasure-2.o jerasure_08.o

cauchy_01: galois-2.o jerasure-2.o cauchy-2.o reed_sol-2.o cauchy_01.o
	$(CC) $(CFLAGS) -o cauchy_01 galois-2.o jerasure-2.o cauchy-2.o reed_sol-2.o cauchy_01.o

cauchy_02: galois-2.o jerasure-2.o cauchy-2.o cauchy_02.o
	$(CC) $(CFLAGS) -o cauchy_02 galois-2.o jerasure-2.o cauchy-2.o cauchy_02.o

cauchy_03: galois-2.o jerasure-2.o cauchy-2.o cauchy_03.o
	$(CC) $(CFLAGS) -o cauchy_03 galois-2.o jerasure-2.o cauchy-2.o cauchy_03.o

cauchy_04: galois-2.o jerasure-2.o cauchy-2.o cauchy_04.o
	$(CC) $(CFLAGS) -o cauchy_04 galois-2.o jerasure-2.o cauchy-2.o cauchy_04.o

liberation_01: galois-2.o jerasure-2.o liberation-2.o liberation_01.o
	$(CC) $(CFLAGS) -o liberation_01 galois-2.o jerasure-2.o liberation-2.o liberation_01.o

encoder: galois-2.o jerasure-2.o liberation-2.o cauchy-2.o reed_sol-2.o encoder.o
	$(CC) $(CFLAGS) -o encoder galois-2.o jerasure-2.o cauchy-2.o reed_sol-2.o liberation-2.o encoder.o

decoder: galois-2.o jerasure-2.o liberation-2.o cauchy-2.o reed_sol-2.o decoder.o
	$(CC) $(CFLAGS) -o decoder galois-2.o jerasure-2.o cauchy-2.o reed_sol-2.o liberation-2.o decoder.o
